package net.ghsoft.Convert
{
	import net.ghsoft.SetupGlobal;
	
	public class ConvertBarometer
	{	
		/**
		 * 获取本地温度
		 */ 
		public static function getLocalBarometer(value:Number):Number
		{
			var result:Number = value;
			
			if(SetupGlobal.BarometerUnitLocal == "INHG")
			{
				result = Number((result / 4 * 3/ 10 / 2.539999918).toFixed(2));
			}
			else if(SetupGlobal.BarometerUnitLocal == "MMHG")
			{
				result = Number((result / 4 * 3).toFixed(2)); 
			}
			return result;
		}
		
		/**
		 * 获取本地温度
		 */ 
		public static function getLocalBarometerString():String
		{
			var result:String = "hpa";
			
			if(SetupGlobal.BarometerUnitLocal == "INHG")
			{
				result = "inHg";
			}
			else if(SetupGlobal.BarometerUnitLocal == "MMHG")
			{
				result = "mmHg";
			}
			else
			{
				result = "hpa";
			}
			
			return result;
		}
	}
}